package cn.com.nes.mybatis.agent.ope.mapper;

import cn.com.nes.mybatis.agent.ope.entity.IsProtocolControlCommand;
import cn.com.nes.site.entity.dto.ControlCommandForDropdownDTO;
import cn.com.nes.site.entity.iot.ControlCommandForEquipmentControlParam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 设备协议控制指令表 Mapper 接口
 * </p>
 *
 * @author nes
 * @since 2023-03-07
 */
public interface IsProtocolControlCommandMapper extends BaseMapper<IsProtocolControlCommand> {

    void insertBatch(@Param("insert") Set<IsProtocolControlCommand> insertControlCommands);

    List<Map<String, Object>> getControlCommand(Page<Map<String, Object>> page,
                                                @Param("protocolId") String protocolId,
                                                @Param("name") String name,
                                                @Param("registerAddress") Integer registerAddress,
                                                @Param("registerType") String registerType);

    List<ControlCommandForEquipmentControlParam> getControlCommandForEquipmentControlParam(String protocolId);

    List<Map<String, Object>> getControlParamsByDataItemIds(@Param("dataItems") Collection<String> unStandardDataItems);

    List<Map<String, Object>> getControlParamsByFunctionDetailIds(@Param("functionDetailIds") List<String> functionDetailIds);

    List<ControlCommandForDropdownDTO> getControlCommandForDropdown(@Param("manufactureId") String manufactureId,
                                                                    @Param("protocolId") String protocolId,
                                                                    @Param("functionName") String functionName);
}
